.class public Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;
.super Ljava/util/ArrayList;
.source "IMAIClickEventList.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/util/ArrayList",
        "<",
        "Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;",
        ">;"
    }
.end annotation


# static fields
.field private static final serialVersionUID:J = -0x2f06392ad58e8bbL


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 15
    invoke-direct {p0}, Ljava/util/ArrayList;-><init>()V

    return-void
.end method

.method public static declared-synchronized getLoggedClickEvents()Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;
    .locals 4

    .prologue
    .line 28
    const-class v1, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;

    monitor-enter v1

    const/4 v0, 0x0

    .line 29
    :try_start_0
    invoke-static {}, Lcom/inmobi/commons/internal/InternalSDKUtil;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string v3, "imai_click_events"

    invoke-static {v2, v3}, Lcom/inmobi/commons/internal/FileOperations;->isFileExist(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 31
    invoke-static {}, Lcom/inmobi/commons/internal/InternalSDKUtil;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v2, "imai_click_events"

    invoke-static {v0, v2}, Lcom/inmobi/commons/internal/FileOperations;->readFromFile(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 33
    :cond_0
    if-eqz v0, :cond_1

    .line 36
    :goto_0
    monitor-exit v1

    return-object v0

    :cond_1
    :try_start_1
    new-instance v0, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;

    invoke-direct {v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;-><init>()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 28
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method


# virtual methods
.method public declared-synchronized addClickEvent(Ljava/lang/String;ZZLjava/lang/ref/WeakReference;)Z
    .locals 8
    .parameter
    .parameter
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "ZZ",
            "Ljava/lang/ref/WeakReference",
            "<",
            "Lcom/inmobi/re/container/IMWebView;",
            ">;)Z"
        }
    .end annotation

    .prologue
    const/4 v7, 0x1

    .line 97
    monitor-enter p0

    :try_start_0
    sget-object v0, Lcom/inmobi/androidsdk/impl/net/RequestResponseManager;->isSynced:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 98
    new-instance v0, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;

    const/4 v5, 0x1

    const/4 v6, 0x0

    move-object v1, p1

    move v2, p2

    move v3, p3

    move-object v4, p4

    invoke-direct/range {v0 .. v6}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;-><init>(Ljava/lang/String;ZZLjava/lang/ref/WeakReference;ZI)V

    invoke-virtual {p0, v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 99
    monitor-exit p0

    return v7

    .line 97
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public getClickEvent(I)Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;
    .locals 4
    .parameter

    .prologue
    const/4 v1, 0x0

    .line 53
    .line 55
    :try_start_0
    invoke-virtual {p0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .line 56
    :cond_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 58
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;

    .line 59
    invoke-virtual {v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;->getClickId()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v3

    if-ne v3, p1, :cond_0

    .line 70
    :goto_0
    return-object v0

    .line 65
    :catch_0
    move-exception v0

    .line 67
    const-string v2, "InMobiAndroidSDK_3.7.0"

    const-string v3, "Cant get click event"

    invoke-static {v2, v3, v0}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    move-object v0, v1

    .line 68
    goto :goto_0

    :cond_1
    move-object v0, v1

    .line 70
    goto :goto_0
.end method

.method public declared-synchronized reduceRetryCount(I)V
    .locals 3
    .parameter

    .prologue
    .line 127
    monitor-enter p0

    :try_start_0
    sget-object v0, Lcom/inmobi/androidsdk/impl/net/RequestResponseManager;->isSynced:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 128
    invoke-virtual {p0, p1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->getClickEvent(I)Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;

    move-result-object v0

    .line 129
    invoke-virtual {v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;->getRetryCount()I

    move-result v1

    .line 130
    invoke-virtual {p0, p1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->removeClickEvent(I)Z

    .line 131
    const/4 v2, 0x1

    if-le v1, v2, :cond_0

    .line 132
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;->setFirstClick(Z)V

    .line 133
    invoke-virtual {v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;->getRetryCount()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    invoke-virtual {v0, v1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;->setRetryCount(I)V

    .line 134
    invoke-virtual {p0, v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 140
    :cond_0
    :goto_0
    monitor-exit p0

    return-void

    .line 136
    :catch_0
    move-exception v0

    .line 138
    :try_start_1
    const-string v1, "InMobiAndroidSDK_3.7.0"

    const-string v2, "Cant reduce retry count"

    invoke-static {v1, v2, v0}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 127
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized removeClickEvent(I)Z
    .locals 4
    .parameter

    .prologue
    const/4 v0, 0x0

    .line 80
    monitor-enter p0

    :try_start_0
    sget-object v1, Lcom/inmobi/androidsdk/impl/net/RequestResponseManager;->isSynced:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 81
    invoke-virtual {p0, p1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->getClickEvent(I)Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;

    move-result-object v1

    .line 82
    invoke-virtual {p0, v1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->remove(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 89
    const/4 v0, 0x1

    :goto_0
    monitor-exit p0

    return v0

    .line 84
    :catch_0
    move-exception v1

    .line 86
    :try_start_1
    const-string v2, "InMobiAndroidSDK_3.7.0"

    const-string v3, "Cant remove click event"

    invoke-static {v2, v3, v1}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 80
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized resetFirstClick(I)V
    .locals 3
    .parameter

    .prologue
    .line 111
    monitor-enter p0

    :try_start_0
    sget-object v0, Lcom/inmobi/androidsdk/impl/net/RequestResponseManager;->isSynced:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 112
    invoke-virtual {p0, p1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->getClickEvent(I)Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;

    move-result-object v0

    .line 113
    invoke-virtual {p0, p1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->removeClickEvent(I)Z

    .line 114
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEvent;->setFirstClick(Z)V

    .line 115
    invoke-virtual {p0, v0}, Lcom/inmobi/androidsdk/impl/imai/IMAIClickEventList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 121
    :goto_0
    monitor-exit p0

    return-void

    .line 117
    :catch_0
    move-exception v0

    .line 119
    :try_start_1
    const-string v1, "InMobiAndroidSDK_3.7.0"

    const-string v2, "Cant reset first click flag"

    invoke-static {v1, v2, v0}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 111
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public saveClickEvents()V
    .locals 2

    .prologue
    .line 44
    const-string v0, "InMobiAndroidSDK_3.7.0"

    const-string v1, "Save ping events"

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;)V

    .line 45
    invoke-static {}, Lcom/inmobi/commons/internal/InternalSDKUtil;->getContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "imai_click_events"

    invoke-static {v0, v1, p0}, Lcom/inmobi/commons/internal/FileOperations;->saveToFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/Object;)Z

    .line 46
    return-void
.end method
